package ai.peanut.one.service.impl;

import ai.peanut.one.entity.Activity;
import ai.peanut.one.service.IActivityService;
import ai.peanut.one.service.ITestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TestServiceImpl implements ITestService {
    @Autowired
    private IActivityService iActivityService ;
    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.DEFAULT)

    public void HaveTExe(){
        Activity activity = new Activity() ;
        activity.setName("HaveTExe");
        iActivityService.insert(activity);
    }

}
